package com.biwin.module.org.domain.entity;

import com.biwin.module.orm.api.entity.BwBasicEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * Position Authority Entity 岗位权限
 *
 * @author biwin
 * @since 0.0.1
 */
@Entity
@Table(name = "position_authority")
@org.hibernate.annotations.Table(appliesTo = "position_authority", comment = "岗位权限表")
public class PositionAuthority extends BwBasicEntity {

    private static final long serialVersionUID = -1508128420420513006L;
    @Column(name = "position_id", columnDefinition = "BIGINT(20) NOT NULL COMMENT '岗位id' ")
    private Long position;

    @Column(name = "menu_id", columnDefinition = "BIGINT(20) NOT NULL COMMENT '菜单id' ")
    private Integer menuId;

    @Column(name = "user_permission", columnDefinition = "BIT(1) NOT NULL DEFAULT B'1' COMMENT '是否有使用权限' ")
    private Boolean usePermission = true;

    @Column(name = "authorized_use", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '是否有再授权使用权限' ")
    private Boolean authorizedUse = false;

    @Column(name = "reauthorize", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '是否有再授权权限' ")
    private Boolean reauthorize = false;

    @Column(name = "effect_time", columnDefinition = "DATETIME COMMENT '有效时间' ")
    private Date effectTime;

    public Long getPosition() {
        return position;
    }

    public void setPosition(Long position) {
        this.position = position;
    }

    public Integer getMenuId() {
        return menuId;
    }

    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }

    public Boolean getUsePermission() {
        return usePermission;
    }

    public void setUsePermission(Boolean usePermission) {
        this.usePermission = usePermission;
    }

    public Boolean getAuthorizedUse() {
        return authorizedUse;
    }

    public void setAuthorizedUse(Boolean authorizedUse) {
        this.authorizedUse = authorizedUse;
    }

    public Boolean getReauthorize() {
        return reauthorize;
    }

    public void setReauthorize(Boolean reauthorize) {
        this.reauthorize = reauthorize;
    }

    public Date getEffectTime() {
        return effectTime;
    }

    public void setEffectTime(Date effectTime) {
        this.effectTime = effectTime;
    }
}
